<%--
  Created by IntelliJ IDEA.
  User: 梁家源
  Date: 2021/4/29
  Time: 12:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>安全设置</title>
    <!-- layUI的核心CSS文件 -->
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/static/layui-v2.5.7/layui/css/layui.css"/>
    <!-- layUI的核心JS文件 -->
    <script src="${pageContext.request.contextPath}/static/layui-v2.5.7/layui/layui.js" type="text/javascript"
            charset="UTF-8"></script>
</head>
<body>
<script>
    //JavaScript代码区域
    layui.use('element', function () {
        var element = layui.element;
    });
</script>
<script>
    layui.use('form', function () {
        var form = layui.form;
    });
</script>

<!-- 头部导航栏 -->
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo"><a style="color: #009688;">龙洞闲置购物系统</a></div>

        <!-- 头部区域（可配合layui已有的水平导航） -->

        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item">
                <a href="gotoAdminConsole">后台首页</a>
            </li>
            <li class="layui-nav-item layui-this"style="user-select: none">
                安全设置
            </li>
        </ul>
<%--        <%@include file="../common/head.jsp" %>--%>
        <ul class="layui-nav layui-layout-right " lay-filter="layadmin-layout-right">
            <!-- 如果管理员已登录 -->
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <c:if test="${empty sessionScope.admin.aheadsrc}">
                        <img src="${pageContext.request.contextPath}/static/images/default_head.jpg"
                             class="layui-nav-img"
                            <%--                         style="width: 50px; height: 50px;margin-left: 15px;"--%>
                        >
                        管理员${sessionScope.admin.aname}
                    </c:if>
                    <c:if test="${not empty sessionScope.admin.aheadsrc}">
                        <img src="${admin.aheadsrc}" class="layui-nav-img"
                            <%--                         style="width: 50px; height: 50px;margin-left: 15px;"--%>
                        >
                        管理员${sessionScope.admin.aname}
                    </c:if>
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="${pageContext.request.contextPath}/readAdminInfo">
                        <i class="layui-icon">&#xe68e;</i>&nbsp;我的信息</a>
                    </dd>
                    <dd><a href="${pageContext.request.contextPath}/toAdminPasswordPage">
                        <i class="layui-icon">&#xe683;</i>&nbsp;安全设置</a>
                    </dd>
<%--                    <dd><a href="ShowALLGoods">--%>
<%--                        <i class="layui-icon">&#xe665;</i>&nbsp;商城首页</a>--%>
<%--                    </dd>--%>
                    <dd><a href="${pageContext.request.contextPath}/adminLoginOut">
                        <i class="layui-icon">&#xe682;</i>&nbsp;退出登录</a>
                    </dd>
                </dl>
            </li>
        </ul>
    </div>
</div>

<!-- 安全设置 -->

<div class="layui-row">
    <div class="layui-col-md6 layui-col-lg-offset3" style="margin-top: 80px;border: 1px solid gray; padding: 20px;margin-bottom: 20px;">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend>修改密码</legend>
        </fieldset>
        <form class="layui-form layui-form-pane" action="${pageContext.request.contextPath}/updateAdminPassword" method="post">
            <input type="hidden" name="aid" value="${admin.aid}">
            <div class="layui-col-lg-offset1 layui-col-md10 " style="margin-top:10px;">
                <label class="layui-form-label">原密码</label>
                <div class="layui-input-block">
                    <input type="password" name="" required lay-verify="required" autocomplete="off"
                           class="layui-input" value="${admin.apassword}" disabled>
                </div>
            </div>
            <div class="layui-col-lg-offset1 layui-col-md10 " style="margin-top:10px;">
                <label class="layui-form-label">新密码</label>
                <div class="layui-input-block">
                    <input type="text" name="apassword" required lay-verify="required" autocomplete="off"
                           class="layui-input" value="${admin.apassword}">
                </div>
            </div>


            <div class="layui-col-lg-offset3 layui-col-md10" style="margin-top:30px;">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="save">确认修改</button>
                </div>
            </div>
        </form>


    </div>
</div>

</body>
</html>

